/**
,editoptions:{size:12,dataInit: function(element) {$(element).datepicker({dateFormat: 'yy-mm-dd'})}} 
,formoptions:{elmprefix:'(*)'}
, edittype:'select', editoptions:{value:{1:'One',2:'Two'}}
,editrules:{number:true}
**/

//一、工作人员（Duty Staff Lists）
$(document).ready(function(){	
	$("#list_dsl").jqGrid({
		url: '/ajax/ajax_zy_duty_staff.php?'+url_obj, //显示的数据
		//editurl: '/ajax/ajax_zy_duty_staff.php?'+url_obj,
		datatype: 'json', //xml、json、local(js直接赋值)
		mtype: 'POST',
		colNames: ["序号(Item)", "姓名(Name)","职务(Position)","到达日期(Arrived Date)","离开日期(Departure Date)","工作周期(Duty days)","健康状态(Health)","备注(Marks)","员工类型(Type)"], //表头标题别名
		colModel: [			
			{name: 'ds_id', index: 'ds_id', width: 70,fixed:true,searchoptions:{sopt: ['eq']}},			
			{name: 'name', index: 'name', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'worker', index: 'worker', width: 140,fixed:true, sortable:false, editable:false},
			{name: 'arrived_date', index: 'arrived_date', width: 140, sortable:false, editable:false},
			{name: 'departure_date', index: 'departure_date', width: 140, sortable:false, editable:false},
			{name: 'duty_days', index: 'duty_days', width: 140, sortable:false, editable:false},
			{name: 'health', index: 'health', width: 180, sortable:false, editable:false},
			{name: 'info', index: 'info', width: 180, sortable:false, editable:false},
			{name: 'type', index: 'type', width: 180, sortable:false, editable:false}
		],
		// JSON
		jsonReader: { 
			root: "list_data", 
			page: "page", 
			total: "total", 
			records: "records",
			repeatitems: false
		},
		//width: 600,
		height:130,//整个显示的最大高度
		autowidth:true,
		shrinkToFit:false, //水平滚动条
		pager: $('#pager_dsl'),
		//pgbuttons: true,
		rowNum: 5, //每页显示记录数
		rowList:[5,10,20], //可调整每页显示的记录数
		sortname: 'ds_id',
		rownumbers: true,
		//sortorder: "desc",
		viewrecords: true //是否显示行数
	});
	
	$("#list_dsl").navGrid("#pager_dsl", {
			refresh: true,
			edit: false,
			add: false,
			del:false,
			search: false,
			position: "left"
		}
	);
});

//二、取证状态（Certificate Statistic）
$(document).ready(function(){	
	$("#list_cs").jqGrid({
		url: '/ajax/ajax_zy_certificate_statistic.php?'+url_obj, //显示的数据
		//editurl: '/ajax/ajax_zy_certificate_statistic.php?'+url_obj,
		datatype: 'json', //xml、json、local(js直接赋值)
		mtype: 'POST',
		colNames: ["序号(Item)", "姓名(Name)","取证类别(Certification Type)","取证日期(Date)","发证机构","证件有效期","取证地点","备注(Marks)","员工类型(Type)"], //表头标题别名
		colModel: [			
			{name: 'cs_id', index: 'cs_id', width: 70,fixed:true,searchoptions:{sopt: ['eq']}},			
			{name: 'name', index: 'name', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'cs_type', index: 'cs_type', width: 140,fixed:true, sortable:false, editable:false},
			{name: 'cs_date', index: 'cs_date', width: 140, sortable:false, editable:false},
			{name: 'authority', index: 'authority', width: 140, sortable:false, editable:false},
			{name: 'validity', index: 'validity', width: 140, sortable:false, editable:false},
			{name: 'cs_address', index: 'cs_address', width: 180, sortable:false, editable:false},
			{name: 'info', index: 'info', width: 180, sortable:false, editable:false},
			{name: 'dtype', index: 'dtype', width: 180, sortable:false, editable:false}
		],
		// JSON
		jsonReader: { 
			root: "list_data", 
			page: "page", 
			total: "total", 
			records: "records",
			repeatitems: false
		},
		//width: 600,
		height:130,//整个显示的最大高度
		autowidth:true,
		shrinkToFit:false, //水平滚动条
		pager: $('#pager_cs'),
		//pgbuttons: true,
		rowNum: 5, //每页显示记录数
		rowList:[5,10,20], //可调整每页显示的记录数
		sortname: 'cs_id',
		rownumbers: true, //自动行号
		//sortorder: "desc",
		viewrecords: true //是否显示行数
	});
	
	$("#list_cs").navGrid("#pager_cs", {
			refresh: true,
			edit: false,
			add: false,
			del:false,
			search: false,
			position: "left"
		}
	);
});

//三、休假人员（Duty Off Staff Lists）
$(document).ready(function(){	
	$("#list_dosl").jqGrid({
		url: '/ajax/ajax_zy_duty_off_staff.php?'+url_obj, //显示的数据
		//editurl: '/ajax/ajax_zy_duty_off_staff.php?'+url_obj,
		datatype: 'json', //xml、json、local(js直接赋值)
		mtype: 'POST',
		colNames: ["序号(Item)", "姓名(Name)","职务(Position)","离开日期(Departure Date)","返回日期(Return Date)","休假周期(Vocation days)","健康状态(Health)","备注(Marks)","员工类型(Type)"], //表头标题别名
		colModel: [			
			{name: 'dos_id', index: 'dos_id', width: 70,fixed:true,searchoptions:{sopt: ['eq']}},			
			{name: 'name', index: 'name', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'worker', index: 'worker', width: 140,fixed:true, sortable:false, editable:false},
			{name: 'departure_date', index: 'departure_date', width: 140, sortable:false, editable:false},
			{name: 'return_date', index: 'return_date', width: 140, sortable:false, editable:false},
			{name: 'vocation_days', index: 'vocation_days', width: 140, sortable:false, editable:false},
			{name: 'health', index: 'health', width: 180, sortable:false, editable:false},
			{name: 'info', index: 'info', width: 180, sortable:false, editable:false},
			{name: 'type', index: 'type', width: 180, sortable:false, editable:false}
		],
		// JSON
		jsonReader: { 
			root: "list_data", 
			page: "page", 
			total: "total", 
			records: "records",
			repeatitems: false
		},
		//width: 600,
		height:130,//整个显示的最大高度
		autowidth:true,
		shrinkToFit:false, //水平滚动条
		pager: $('#pager_dosl'),
		//pgbuttons: true,
		rowNum: 5, //每页显示记录数
		rowList:[5,10,20], //可调整每页显示的记录数
		sortname: 'dos_id',
		rownumbers: true, //自动行号
		//sortorder: "desc",
		viewrecords: true //是否显示行数
	});
	
	$("#list_dosl").navGrid("#pager_dosl", {
			refresh: true,
			edit: false,
			add: false,
			del:false,
			search: false,
			position: "left"
		}
	);
});